home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light
/
Light_Vol.1_August_1992_Datasphere_Publications_Disk_1_of_2_Side_A.d64
/
address change
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
10KB
|
365 lines
1 rem"********************"
2 rem"*[195]hange [204]oad adress*"
3 rem"* by [193]ndrew [198]isher *"
4 rem"********************"
10 printchr$(14);chr$(8);"[147][154][204]oading machine code... [208]lease wait..."
11 a=a+1:ifa=1 thenload"machine code1",8,1
12 ifa=2 then load"machine code2",8,1
20 print"[147]";:poke646,peek(53281):print"5 goto100":print"run"
30 poke198,3:poke631,19:poke632,13:poke633,13:end
40 print"[154][147][154][197]nter device number ";:inputde$:d=val(de$):ifd<8 or d>12 then40
41 poke679,d
42 ifq=1 then goto1101
43 ifq=2 thengoto1201
44 ifq=3 then goto 1301
45 ifq=4 then1351
46 ifq=5 then1401
47 ifq=6 then1601
48 ifq=7then1501
49 ifq=8then1705
50 ifq=9 then341
51 ifq=10 then201
100 gosub4000:print"[154] [195]hange [204]oad [193]ddress "
101 print" [196]irectory "
102 print" [196]isk & file commands "
103 print" [209]uit "
110 poke700,3:poke701,35:poke702,9:poke703,11:poke704,13:poke705,15
120 poke706,255:sys52985
130 z=peek(2)
140 onzgoto200,1100,700,2500
150 goto100
200 rem q=10:goto40
201 rem clr:de=peek(679)
210 so$="":print"[197]nter name of file:";
220 geta$:ifa$=""then220
230 a=asc(a$):ifa=13 then270
232 ifa$=chr$(20) then240
234 if(a<32)or((a>127)and(a<160))then220
236 iflen(so$)<16 then so$=so$+a$:print": ";
237 print":";so$
238 goto220
240 iflen(so$)<1 then 220
250 so$=left$(so$,len(so$)-1)
252 print" ";
253 iflen(so$)>0 thenprint":";so$
254 goto220
270 rem
295 print"[197]nter load address:";
296 geta$:ifa$=""then296
297 a=asc(a$):ifa=13 then308
298 ifa$=chr$(20)then303
300 if(a<32)or((a>127)and(a<160))then296
301 iflen(ad$)<5thenad$=ad$+a$:poke781,5:poke782,19:poke783,0:sys65520:printad$
302 goto296
303 iflen(ad$)<1 then296
304 ad$=left$(ad$,len(ad$)-1)
305 poke781,5:poke782,19:poke783,0:sys65520:print" [157][157][157][157][157]";
306 iflen(ad$)>0thenprintad$
307 goto296
308 ifleft$(ad$,1)="$" then 311
309 ad=val(ad$):h=int(ad/256):l=(ad-h*256)
310 goto320
311 h$=right$(ad$,4)
312 d=0:ifh$>""thenfori=1tolen(h$):a=asc(mid$(h$,i,1))-48:d=d*16+a+(a>9)*7:next
313 h=int(d/256):l=(d-h*256)
320 rem
332 poke781,6:poke782,0:poke783,0:sys65520:print"[195]ontinue?:[217][197][211][146][206][207]":c=1
333 geti$:ifi$=""then333
334 ifi$=chr$(17)thenc=1-c
335 ifi$=chr$(145)thenc=1-c
336 ifc=1thenpoke781,6:poke782,10:poke783,0:sys65520:print"[217][197][211][146][206][207]"
337 ifc=0thenpoke781,6:poke782,10:poke783,0:sys65520:print"[146][217][197][211][206][207][146]"
338 ifi$=chr$(13)thenc=c+1:oncgoto100,340
339 goto333
340 q=9:goto40
341 de=peek(679):d$=so$
343 print"[211]earching for "d$" - press a key"
344 poke198,0:wait198,1:poke198,0
345 sd$="":sd$=d$:fors=1to19:gosub1000:ifj=k thenx=fe:y=s:s=19
346 nexts:print"[195]hanging load addr. of "d$
347 open8,de,15:open4,8,4,"#"
348 bp=(x-1)*32+3:print#8,"u1:"4;0;18;y
349 print#8,"b-p:"4;bp
350 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
351 close4:close8
352 open8,de,15:open4,8,4,"#"
353 print#8,"u1:"4;0;tr;se
354 print#8,"b-p:"4;2
355 print#4,chr$(l);chr$(h);
356 print#8,"u2:"4;0;tr;se
376 close4:p=9:goto1503
377 close8:print"[210]eturning to main menu"
378 fort=1to500:next:goto100
699 goto100
700 gosub3180
710 poke700,8:poke701,23:poke702,4:poke703,6:poke704,8:poke705,13
720 poke706,15:poke707,17:poke708,20:poke709,22:poke710,255:sys52985
730 w=peek(2)
740 on w goto 1300,1200,1350,1600,1400,1700,1500,750
750 goto100
999 end
1000 forg=1to16-len(sd$)
1001 sd$=sd$+chr$(160)
1002 next
1003 open8,de,15
1004 open4,de,4,"#"
1005 print"[147][211]earching sector"s
1006 forfe=1to8
1007 print#8,"u1:";4;0;18;s
1008 bp=(fe-1)*32+2
1009 print#8,"b-p:"4;bp
1010 get#4,p$,t$,s$
1011 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
1012 if(tr=1andse=1)thenfe=8:goto 1020
1013 x=x+1:get#4,n$
1014 na$=na$+n$
1015 ifx<16 then 1013
1017 goto 1024
1018 ifj=k then 1021
1019 goto 1030
1020 nextfe
1021 close4:close8
1022 return
1023 close4:close8:return
1024 j=1:fork=1to16
1025 q=asc(mid$(na$,k,1)+chr$(0))
1026 w=asc(mid$(sd$,k,1)+chr$(0))
1027 ifq=w then j=j+1
1028 nextk
1029 goto 1018
1030 na$="":x=0:t$="":s$="":tr=0:se=0:ty$="":q=0:w=0:goto 1020
1100 q=1:goto40
1101 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
1102 poke198,0:wait198,1:poke198,0:open8,de,15
1103 print#8,"i"
1104 open4,de,4,"#"
1105 print#8,"m-r"chr$(144)chr$(7)chr$(16)
1106 input#8,x$
1107 fort=1to19
1108 print"[147]"spc(6)"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
1109 printspc(6)"[221][196]iskname:[146]"x$" [221]"
1110 printspc(6)"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][178][192][192][192][192][179]"
1111 printspc(6)"[221][198]ile name [221][212]ype[221][211]ize[221]"
1112 printspc(6)"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
1113 print#8,"u1:"4;0;18;t
1114 foru=1to8
1115 bp=(u-1)*32+2
1116 print#8,"b-p:"4;bp
1117 get#4,p$,t$,s$
1118 tr=asc(t$+chr$(0)):se=asc(s$+chr$(0))
1119 if(tr=1andse=1) thenu=8:v=1:goto 1140
1120 if(tr=0andse=0)thenu=8:goto 1140
1121 x=x+1:get#4,n$
1122 na$=na$+n$
1123 ifx<16 then 1121
1124 bp=bp+28
1125 print#8,"b-p:"4;bp
1126 get#4,l$,h$
1127 bl=asc(l$+chr$(0))+256*asc(h$+chr$(0))
1128 p=asc(p$+chr$(0)):p=p-128:ifp>5thenp=p-64
1129 ifp=1 thenty$="[211]eq":qs=qs+1
1130 ifp=2 thenty$="[208]rg":qp=qp+1
1131 ifp=3 thenty$="[213]sr":qu=qu+1
1132 ifp=4 thenty$="[210]el":qr=qr+1
1133 ifp<1 thengosub 1159:nextu:goto 1142
1134 printspc(6)"[221]"na$"[221]";ty$;" [221]";bl;
1135 ifbl<10thenprint" [221]"
1136 ifbl>10andbl<100thenprint"[221]"
1137 ifbl>100thenprint"[157][221]"
1138 tb=tb+bl
1139 gosub 1159
1140 nextu
1141 ifv=1thenv=0:nextt:goto 1145
1142 printspc(6)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
1143 poke198,0:print""spc(6)"[208]ress a key to view next page"
1144 wait198,1:poke198,0:next
1145 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
1146 print"[221][211]tatistics for "x$"[221]"
1147 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
1148 n=qp+qr+qs+qu:print"[212]otal number of files:"n
1149 print"[208]rg files:"qp
1150 print"[211]eq files:"qs
1151 print"[210]el files:"qr
1152 print"[213]sr files:"qu
1153 print"[194]locks used:"tb
1154 print"[194]locks free:"664-tb
1155 print"[208]ress a key to return to main menu"
1156 poke198,0:wait198,1:poke198,0
1157 close4:close8
1158 goto100
1159 na$="":x=0:ty$="":p$="":p=0:return
1200 q=2:goto40
1201 clr:de=peek(679):print"[147][201]nsert disk to format in device"de
1202 print"& press a key":poke198,0:wait198,1:poke198,0
1203 open8,de,15:open4,de,4,"#"
1204 print#8,"u1:"4;0;18;0
1205 input#8,e
1206 ife>5then1208
1207 goto1226
1208 close4
1209 print"[147][196]isk needs to be formatted. [201]s this ok"
1210 inputan$
1211 ifan$="n"thenclose8:goto700
1212 ifan$<>"y"then1209
1213 print"[197]nter disk name and id"
1214 inputdn$,id$
1215 print"[147][196]isk to be formatted as "dn$
1216 print"with id "id$
1217 input"[201]s this ok";an$
1218 ifan$="n"then1213
1219 ifan$<>"y"then1215
1220 print#8,"n0:"+dn$+","+id$
1221 open4,de,4,"#"
1222 print#8,"u1:"4;0;18;0
1223 input#8,e
1224 ife>5thenprint"[147][196]isk error!!!":fort=0to1000:next:close8:goto1200
1225 print"[147][196]isk formatted ok":fort=0to1000:next:close8:goto700
1226 close4:print"[147][196]isk needs to be cleared"
1227 print"[201]s this ok";:inputan$
1228 ifan$="n"thenclose8:goto700
1229 ifan$<>"y"then1227
1230 print"[147][201]nput new disk name"
1231 inputdn$
1232 print#8,"n0:"+dn$
1233 open4,de,4,"#"
1234 print#8,"u1:"4;0;18;0
1235 input#8,e
1236 ife>5thenprint"[147][196]isk error!!!":fort=0to1000:next:close8:goto1200
1237 print"[147][196]isk cleared ok":close8:goto700
1300 q=3:goto40
1301 clr:de=peek(679):print"[147][154][201]nsert disk to validate in device"de
1302 print"[208]ress a key to continue"
1303 poke198,0:wait198,1:poke198,0
1304 print"[214]alidating... [208]lease wait..."
1305 open8,de,15,"v"
1306 p=3:goto1503
1308 fort=1to500:next:close8:goto700
1350 q=4:goto40
1351 clr:de=peek(679):print"[147][201]nitialising disk in device"de
1352 print"[208]lease wait..."
1353 open8,de,15,"i"
1354 p=4:goto1503
1355 fort=1to500:next
1356 close8:goto700
1400 q=5:goto40
1401 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
1402 poke198,0:wait198,1:poke198,0
1403 input"[198]ile name";sd$
1404 print"[201]s sector known?":gosub1438
1405 ift=0 then t=1
1406 fors=tto19:gosub1000:ifj=k thenx=s:y=fe:s=19
1407 nexts:ifx=0 thenprint"[198]ile not found":close4:close8:forg=1to1500:nextg:goto700
1408 open8,de,15:open4,de,4,"#"
1409 bp=y-1:bp=bp*32:bp=bp+2
1410 print#8,"u1:"4;0;18;x
1411 print#8,"b-p:"4;bp
1412 get#4,p$:p=asc(p$+chr$(0))
1413 ifp>135 thenp=p-192:l%=1:goto1426
1414 ifp>5 thenp=p-128:l%=0
1415 print"[198]ile is unlocked":print"[196]o you wish to lock it?"
1416 getk$:ifk$=""then1416
1417 ifk$<>"y"thengoto1422
1418 p=p+192:p$=chr$(p)
1419 print#8,"b-p:"4;bp
1420 print#4,p$:print#8,"u2:"4;0;18;x
1421 close4:close8
1422 print"[193]nother file?"
1423 getk$:ifk$="" then1423
1424 ifk$="y" thengoto1400
1425 close4:close8:goto700
1426 print"[198]ile is locked":print"[196]o you wish to unlock it?"
1427 getk$:ifk$=""then1427
1428 ifk$<>"y" then1433
1429 print#8,"b-p:"4;bp
1430 p=p+128:p$=chr$(p)
1431 print#8,"b-p:"4;bp
1432 print#4,p$:print#8,"u2:"4;0;18;x
1433 close4:close8
1434 print"[193]nother file?"
1435 getk$:ifk$="" then1435
1436 ifk$="y" then goto1400
1437 goto700
1438 getk$:ifk$=""then1438
1439 ifk$<>"y"thent=0:return
1440 print"[211]ector";:inputt:return
1500 q=7:goto40
1501 clr:de=peek(679):print"[147][154][197]rror channel of device"de"reads:-"
1502 open8,de,15
1503 input#8,en,e$,tr,se
1504 ifen=1 thenprint""tr" files scratched":goto1508
1505 ifen=0 thenprint"[196]evice"de"[207][203]":goto1508
1506 print""e$"at ("tr","se")"
1507 print"([197]rror number"en")"
1508 ifp>0 then1511
1509 print"[208]ress a key to return to disk menu":poke198,0:wait198,1:poke198,0
1510 close8:goto700
1511 rem
1513 ifp=3 then 1308
1514 ifp=4 then 1355
1516 ifp=6 then 1609
1518 ifp=8 then 1730
1519 ifp=9 then377
1520 close8:goto700
1600 q=6
1601 clr:de=peek(679):print"[147][154][201]nsert disk in device"de"& press a key"
1602 poke198,0:wait198,1:poke198,0
1603 input"[198]ile to scratch";f$
1604 print"[211]cratching "f$:print"[193]re you sure?"
1605 getk$:ifk$<>"y"andk$<>"n" then1605
1606 ifk$="n" then 700
1607 open8,de,15,"s:"+f$
1608 p=6:goto1503
1609 print"[193]nother file?"
1610 getk$:ifk$=""then1610
1611 ifk$="y"then1601
1612 close8:goto700
1700 q=8:goto40
1705 clr:de=peek(679):print"[147][201]nsert disk in device"de"& press a key"
1710 print"[198]ile to rename";:inputo$
1715 print"[206]ew name for "o$;:inputn$
1720 print"[210]enaming "o$" as "n$
1725 open8,8,15,"r:"+n$+"="+o$
1726 p=8:goto1503
1730 print"[193]nother file?"
1735 getk$:ifk$=""then1735
1740 ifk$="y"then1705
1745 goto700
2500 print"[147][208]ress b for [194]asic"
2510 print"[208]ress x to reset"
2520 print"press r to rerun"
2530 geta$:ifa$=""then2530
2540 ifa$="x" then sys64738
2550 ifa$="r" then run
2560 ifa$="b" then end
2570 goto2530
3180 print"[147]";:poke53280,14:poke53281,6
3185 poke53265,peek(53265)and191:poke53270,peek(53270)and239
3190 poke53272,(peek(53272)and240)or6
3195 printspc(7)"[154][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]":printspc(7)"[221][196]isk[195]ommands";
3200 print"{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
3205 printspc(7)"{$7d}Validate{$7d}":printspc(7)"{$7d}";
3210 print"{$7d}":printspc(7)"{$7d}Format{$7d}"
3215 printspc(7)"{$7d}{$7d}":printspc(7)"{$7d}Initialise";
3220 print"{$7d}":printspc(7)"{$7d}{$7d}"
3225 printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]":printspc(7)"{$7d}FileCommands";
3230 print"{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
3235 printspc(7)"{$7d}Deletefile{$7d}":printspc(7)"{$7d}";
3240 print"{$7d}":printspc(7)"{$7d}Check/changeprotection{$7d}"
3245 printspc(7)"{$7d}{$7d}":printspc(7)"{$7d}Renamefile";
3250 print"{$7d}":printspc(7)"{$7d}{$7d}"
3255 printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]":printspc(7)"{$7d}ReadErrorChanne";
3260 print"l{$7d}":printspc(7)"[171]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}[179]"
3265 printspc(7)"{$7d}Quittomainmenu{$7d}":printspc(7)"[173]{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}";
3270 print"{$60}{$60}{$60}[189]"
3275 return
4000 print"[154][147][154][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
4010 print"[221] [221]"
4020 print"[221] [221]"
4030 print"[221] [221]"
4040 print"[221] [221]"
4050 print"[221] [221]"
4060 print"[221] [221]"
4065 print"[221] [221]"
4070 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
4999 return